//
//  SecondChapterViewController.m
//  CoreAnimation
//
//  Created by 张国文 on 16/10/9.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "SecondChapterViewController.h"
#import "AnchorPoint2ViewController.h"
#import "CoordinateSystemViewController.h"
#import "ContainsPointAndHitTestViewController.h"
#import "AutoLayoutOfLayerViewController.h"
#import "LayoutSubivewOfUIViewViewController.h"

@interface SecondChapterViewController ()

@end

@implementation SecondChapterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom];
    firstButton.frame = CGRectMake(0, 20, 300, 50);
    [firstButton setTitle:@"anchorPoint" forState:UIControlStateNormal];
    [firstButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    firstButton.tag = 100;
    [firstButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:firstButton];
    
    UIButton *secondButton = [UIButton buttonWithType:UIButtonTypeCustom];
    secondButton.frame = CGRectMake(0, 120, 300, 50);
    [secondButton setTitle:@"坐标系" forState:UIControlStateNormal];
    [secondButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    secondButton.tag = 101;
    [secondButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:secondButton];
    
    UIButton *thirdButton = [UIButton buttonWithType:UIButtonTypeCustom];
    thirdButton.frame = CGRectMake(0, 220, 300, 50);
    [thirdButton setTitle:@"layer层的触摸点检测" forState:UIControlStateNormal];
    [thirdButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    thirdButton.tag = 102;
    [thirdButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:thirdButton];
    
    UIButton *fourthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fourthButton.frame = CGRectMake(0, 320, 300, 50);
    [fourthButton setTitle:@"layer层自动布局" forState:UIControlStateNormal];
    [fourthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fourthButton.tag = 103;
    [fourthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fourthButton];
    
    UIButton *fivethButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fivethButton.frame = CGRectMake(0, 420, 300, 50);
    [fivethButton setTitle:@"UIView旋转测试" forState:UIControlStateNormal];
    [fivethButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fivethButton.tag = 104;
    [fivethButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fivethButton];
}

- (void)clickJump:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
            AnchorPoint2ViewController *anchorPointVC = [[AnchorPoint2ViewController alloc] init];
            [self.navigationController pushViewController:anchorPointVC animated:YES];
            break;
        }
        case 101:
        {
            CoordinateSystemViewController *coordinateSystemVC = [[CoordinateSystemViewController alloc] init];
            [self.navigationController pushViewController:coordinateSystemVC animated:YES];
            break;
        }
            case 102:
        {
            ContainsPointAndHitTestViewController *containsPointAndHitTestVC = [[ContainsPointAndHitTestViewController alloc] init];
            [self.navigationController pushViewController:containsPointAndHitTestVC animated:YES];
            break;
        }
            case 103:
        {
            AutoLayoutOfLayerViewController *autoLayoutOfLayerVC = [[AutoLayoutOfLayerViewController alloc] init];
            [self.navigationController pushViewController:autoLayoutOfLayerVC animated:YES];
            break;
        }
            case 104:
        {
            LayoutSubivewOfUIViewViewController *layoutSubviewOfUIViewVC = [[LayoutSubivewOfUIViewViewController alloc] init];
            [self.navigationController pushViewController:layoutSubviewOfUIViewVC animated:YES];
            break;
        }
        default:
            break;
    }
}


@end
